﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MVCBugTracker.ViewModels.ProjectEditViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Edit
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Edit Project</h2>
    <% Html.EnableClientValidation(); %>
    <% using (Html.BeginForm())
       {%>
    <%: Html.ValidationSummary(true) %>
    <% Html.RenderPartial("Message", Model); %>
    <fieldset>
        <legend>Fields</legend>
        <div style="float:left; width: 500px">
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Project.Name) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Project.Name)%>
                <%: Html.ValidationMessageFor(model => model.Project.Name)%>
            </div>
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Project.Description) %>
            </div>
            <div class="editor-field">
                <%: Html.TextAreaFor(model => model.Project.Description, new  { style = "width:400px", rows = "4" })%>
                <%: Html.ValidationMessageFor(model => model.Project.Description)%>
            </div>
            <p>
                <input type="submit" value="Save" />
            </p>
        </div>
        <div style="float: left">
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Project.CreatorName)%>
            </div>
            <div class="editor-field">
                <%: Model.Project.CreatorName%>
            </div>
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Project.DateCreated)%>
            </div>
            <div class="editor-field">
                <%:  String.Format("{0:g}", Model.Project.DateCreated)%>
            </div>
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Project.LastUpdate)%>
            </div>
            <div class="editor-field">
                <%: String.Format("{0:g}", Model.Project.LastUpdate)%>
            </div>
        </div>
        <div class="clear">
        </div>
    </fieldset>
    <% } %>
    <div class="tab-container">
        <div id="tabs">
            <ul>
                <li><a href="#tabs-1">Milestones</a></li>
                <li><a href="#tabs-2">Categories</a></li>
                <li><a href="#tabs-3">Priorities</a></li>
                <li><a href="#tabs-4">Statuses</a></li>
                <%--<li><a href="#tabs-5">Custom Fields</a></li>--%>
                <li><a href="#tabs-6">Members</a></li>
            </ul>
            <div id="tabs-1">
                <% Html.RenderPartial("ProjectMilestones", Model.ProjectMilestoneViewModel); %>
            </div>
            <div id="tabs-2">
                <% Html.RenderPartial("ProjectCategories", Model.ProjectCategoryViewModel); %>
            </div>
            <div id="tabs-3">
                <% Html.RenderPartial("ProjectPriorities", Model.ProjectPriorityViewModel); %>
            </div>
            <div id="tabs-4">
                <% Html.RenderPartial("ProjectStatuses", Model.ProjectStatusViewModel); %>
            </div>
            <%--<div id="tabs-5">
                <% Html.RenderPartial("ProjectCustomFields", Model.ProjectCustomFieldViewModel); %>
            </div>--%>
            <div id="tabs-6">
                <% Html.RenderPartial("ProjectMembers", Model.ProjectMemberViewModel); %>
            </div>
        </div>
    </div>
    <br />
    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>
    <script type="text/javascript">
        $(function () {
            $("#tabs").tabs();
        });
    </script>
</asp:Content>
